<template>
    <div>
        <h1 style="text-align: left;">薪资项</h1><br>
        
        <el-form :model="formData" ref="form" :rules="rules" label-width="80px" :inline="true" style="display: flex; flex-direction: column; gap: 16px; text-align: left;">
            
            <el-form-item label="">
                
                <el-row :gutter="20" style="width: 100%;">
                    <el-col :span="12" :offset="0">
                        <span>部门</span>
                        <el-input v-model="formData.departmental"></el-input>
                        <span>基本工资</span>
                        <el-input v-model="formData.baseSalary"></el-input>
                        <span>工龄补贴</span>
                        <el-input v-model="formData.seniorityWages"></el-input>
                        <span>交通补贴</span>
                        <el-input v-model="formData.transportationSubsidy"></el-input>
                        <span>餐饮补贴</span>
                        <el-input v-model="formData.mealSubsidy"></el-input>
                    </el-col>
                    
                    <el-col :span="12" :offset="0">
                        <span>岗位</span>
                        <el-input v-model="formData.postsName"></el-input>
                        <span >绩效工资</span>
                        <el-input v-model="formData.paySalary"></el-input>
                        <span>基本奖金</span>
                        <el-input v-model="formData.bonus"></el-input>
                        <span>住房补贴</span>
                        <el-input v-model="formData.housingAllowance"></el-input>
                        <span>其他补贴</span>
                        <el-input v-model="formData.otherSubsidies"></el-input>
                    </el-col>                       
                </el-row>
                
                       
                                
            </el-form-item>
            <el-form-item  style="margin-top: auto; align-self: flex-start;">
                <el-button type="primary" @click="onSubmit">提交</el-button>
                
            </el-form-item>
        </el-form>
        
        
    </div>
</template>

<script setup>
import { ref,defineEmits } from 'vue';
import request from '@/api/request.js'

let emits=defineEmits(['ref-table'])
let props=defineProps(["data"])

let formData = ref({
    ...props.data
})
const onSubmit = () => {
    request({
        url: '/salary/setup/disposition/update',
        method: 'put',
        data: formData.value
    }).then(res => {
        emits('ref-table');//刷新列表
    })
}
</script>

<style scoped>

</style>
